Skip to content

feat(packs): independent packs skeleton, boundary gates and TypeScript pack conformance (ADR-0069) - #647

Merged
dmealing merged 8 commits into
mainfrom
fm/mo-packs-a0-skeleton
Nov 25, 2026
Merged

dmealing merged 8 commits into
mainfrom
fm/mo-packs-a0-skeleton

Conversation

@dmealing

@dmealing dmealing commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

What Changed

  • Write down the independent-packs ruling: new ADR-0069 (two pack kinds, one-way dependency — core never depends on a pack, pack-side versioning outside metamodelVersion and expected-registry.json), plus matching paragraphs in GOVERNANCE.md, the providers guide, docs/CONFORMANCE.md, the compatibility policy (provider contract now covered by core's package version) and RELEASING.md; also fixes RELEASING's stale "Isolated patch" section and the CHANGELOG 1.3.0 line that said 14 lockstep packages (it is 13), and adds a packs/ MAINTAINERS entry.
  • Lay down the packs/ skeleton so pack work cannot disturb core: the root workspace globs packs/*/typescript while the root build/typecheck scripts name core's workspace directories only; new scripts/check-pack-boundary.ts and scripts/check-pack-manifests.ts gates (in gates) fail if core ever names a pack, a pack's vocabulary enters the default bundle, or release tooling would publish one, and hold each pack.json to its ports' native manifests; a new packs lane in ci-local.sh (wired into local-ci.yml, pr-ci.yml and the lane map) blocks on a pack's own change and reports a pack a core change broke as a named non-failing canary SKIP.
  • TypeScript pack conformance: pack-vocabulary.ts pins the registry rows a pack adds (expected-vocabulary.json) and fails any that change the bundle's, pack-conformance.ts runs a pack's load fixtures through a new corpus-root entry point runCorpus/runAndClassify/loadErrorCodes exported from @metaobjectsdev/conformance (with requireProviders forcing each scenario to name the pack), and createTsAdapter gains additive-only extra providers so a pack cannot stand in for a bundled one.

No pack content ships and nothing published changes: no pack exists under packs/, core vocabulary, metamodelVersion and expected-registry.json are untouched, and the lane passes with a note while that holds.

Validation

Risk Assessment

✅ Low: Change is tooling, CI and docs only: it adds no packs, publishes nothing, leaves core vocabulary, metamodelVersion and expected-registry.json untouched, and every required item in the intent is present and wired. The pack boundary and manifest gates pass on the current tree, and the scoped bun path filters match core's packages. I did not run the tests, as instructed.

Testing

The configured test command (scripts/ci-local.sh --affected --strict-toolchains) already passed at the target commit as broad regression. On top of it I drove the change's runtime surface — the packs CI lane and the boundary/manifest/vocabulary/conformance CLIs — live, on the untouched tree and against a disposable packs/smoke pack I built in the worktree from the fixture corpus and removed afterwards (bun.lock churn restored via git checkout, worktree verified clean). The skeleton lane passes with its no-pack note; a complete throwaway pack goes green end-to-end (pin written, its load fixture runs through the TypeScript adapter with the pack composed in, manifests agree, and the lane's blocking 'pack smoke' step passes including the pack's own tsc typecheck); and every guard added by this change refuses its violation with the exact ADR message: core naming a pack coordinate, manifest version drift, a pack mutating a bundle-declared row ('does not leave core alone — changed: default object'), and a pack corpus scenario that does not name the pack. No UI surface is involved, so there are no screenshots; evidence is CLI transcripts in the evidence directory.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Shipped skeleton passes its own gates: scripts/ci-local.sh --only packs on the untouched tree reports 'no independent pack with a TypeScript port — nothing to check' and exits 0; `bun scripts/check-… ✅ pass live s1-lane-skeleton.txt, s1-boundary-skeleton.txt, s1-manifests-skeleton.txt
First pack goes green end-to-end: a disposable packs/smoke (pack.json + TypeScript provider registering layout.picker and two field.string attrs + a load fixture copied from fixtures/conformance/provi… ✅ pass live s2-vocab-missing.txt, s2-vocab-write.txt, s2-vocab-green.txt, s2-conformance.txt, s2-manifests-green.txt, s2-boundary-green.txt, s2-lane-with-pack.txt, s2-typecheck.txt
Adversarial: each guard refuses its violation — a core file importing @metaobjectsdev/pack-smoke fails the boundary gate ('core names a pack coordinate'), a package.json version that disagrees with pa… ✅ pass live s3-boundary-violation.txt, s3-manifest-violation.txt, s3-corechange-violation.txt, s3-conformance-providerless.txt, s3-conformance-providerless-fixed.txt
Evidence: S1: packs lane on untouched skeleton

── packs: no independent pack with a TypeScript port under packs/ — nothing to check ── ... LOCAL CI PASSED

metaobjects local CI  (mode: only:packs)

── packs: no independent pack with a TypeScript port under packs/ — nothing to check ──

══════════════════════ SUMMARY ══════════════════════
── slowest steps ──
  total wall time: 0s
══════════════════════════════════════════════════════
LOCAL CI PASSED
Evidence: S1: boundary + manifests gates on untouched skeleton

pack boundary: OK (0 pack(s); core names none, the bundle holds none, the release tooling sees none) | pack manifests: OK (0 packs)

pack boundary: OK (0 pack(s); core names none, the bundle holds none, the release tooling sees none)
Evidence: S2: vocabulary pin missing → --write → green

✖ fixtures/expected-vocabulary.json is missing — run: bun scripts/pack-vocabulary.ts smoke --write → 'wrote fixtures/expected-vocabulary.json' → 'pack smoke: vocabulary pinned, leaves core alone'

$ bun scripts/pack-vocabulary.ts smoke  (pin not yet written)
pack smoke: 1 problem(s)
  ✖ fixtures/expected-vocabulary.json is missing — run: bun scripts/pack-vocabulary.ts smoke --write
exit=1
Evidence: S2: pack conformance through the TS adapter

pack smoke: conformance 1 pass

pack smoke: conformance 1 pass
Evidence: S2: full packs lane with the pack, blocking step

── ✓ packs: core build (5s) ── ✓ pack smoke (1s) ... LOCAL CI PASSED

metaobjects local CI  (mode: only:packs)

── ▶ packs: core build ──────────────────────────────────────────────
bun install v1.3.14 (0d9b296a)
Saved lockfile

Checked 567 installs across 595 packages (no changes) [8.00ms]
$ bun run --filter './server/typescript/packages/*' --filter './client/web/packages/*' --filter './examples/dynamic-grid' build
@metaobjectsdev/render build: Exited with code 0
@metaobjectsdev/metadata build: Exited with code 0
@metaobjectsdev/sdk build: bundled agent-context → {run-worktree}/server/typescript/packages/sdk/agent-context
@metaobjectsdev/conformance build: Exited with code 0
@metaobjectsdev/runtime-web build: Exited with code 0
@metaobjectsdev/sdk build: Exited with code 0
@metaobjectsdev/docs-site build: Exited with code 0
@metaobjectsdev/angular build: Exited with code 0
@metaobjectsdev/tanstack build: Exited with code 0
@metaobjectsdev/react build: Exited with code 0
@metaobjectsdev/migrate-ts build: Exited with code 0
@metaobjectsdev/runtime-ts build: Exited with code 0
@metaobjectsdev/ai-runtime build: Exited with code 0
@metaobjectsdev/codegen-ts build: Exited with code 0
@metaobjectsdev/codegen-ts-tanstack build: Exited with code 0
@metaobjectsdev/codegen-ts-react build: Exited with code 0
@metaobjectsdev/codegen-ts-angular build: Exited with code 0
@metaobjectsdev/cli build: Exited with code 0
── ✓ packs: core build (5s)

── ▶ pack smoke ──────────────────────────────────────────────
$ tsc --noEmit
pack smoke: vocabulary pinned, leaves core alone
pack smoke: conformance 1 pass
── ✓ pack smoke (1s)

══════════════════════ SUMMARY ══════════════════════
  ✓ packs: core build  (5s)
  ✓ pack smoke  (1s)
── slowest steps ──
        5s  packs: core build
        1s  pack smoke
  total wall time: 6s
══════════════════════════════════════════════════════
LOCAL CI PASSED
Evidence: S3: boundary gate refuses core naming a pack

✖ server/typescript/packages/metadata/src/zz-smoke-violation.ts:1: core names a pack coordinate — core may never depend on a pack (exit 1; green again after removal)

pack boundary: 1 problem(s) (ADR-0069)
  ✖ server/typescript/packages/metadata/src/zz-smoke-violation.ts:1: core names a pack coordinate — core may never depend on a pack
Evidence: S3: manifests gate refuses version drift

✖ packs/smoke/typescript/package.json: version is "0.2.0", pack.json says "0.1.0" (exit 1; green again after revert)

pack manifests: 1 problem(s)
  ✖ packs/smoke/typescript/package.json: version is "0.2.0", pack.json says "0.1.0"
Evidence: S3: vocabulary gate refuses a pack that mutates the bundle

✖ does not leave core alone — changed: default object (was "entity", now "value") (exit 1)

pack smoke: 1 problem(s)
  ✖ does not leave core alone — changed: default object
      was "entity"
      now "value"
Evidence: S3: pack corpus scenario must name the pack

✖ loads [fail]: providers.json must name "metaobjects-smoke" (it lists: metaobjects-core-types) (exit 1; exit 0 once the pack is named — see s3-conformance-providerless-fixed.txt)

pack smoke: conformance FAILED (1 fail)
  ✖ loads [fail]: providers.json must name "metaobjects-smoke" (it lists: metaobjects-core-types)
  • Outcome: ⚠️ 1 info across 1 run (16m58s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 info
  • ℹ️ scripts/lib/packs.ts:133 - A half-authored pack directory (typescript/package.json present but pack.json not yet written) makes bun scripts/pack-conformance.ts <name> / pack-vocabulary.ts abort with a raw ENOENT stack trace from readPackManifest instead of a named problem message; check-pack-boundary's packsById tolerates this case, the two pack scripts do not. Observed only while building a throwaway fixture; no committed code path hits it today, and check-pack-manifests would flag the malformed pack first in CI.
  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Shipped skeleton passes its own gates: scripts/ci-local.sh --only packs on the untouched tree reports 'no independent pack with a TypeScript port — nothing to check' and exits 0; `bun scripts/check-… ✅ pass live s1-lane-skeleton.txt, s1-boundary-skeleton.txt, s1-manifests-skeleton.txt
First pack goes green end-to-end: a disposable packs/smoke (pack.json + TypeScript provider registering layout.picker and two field.string attrs + a load fixture copied from fixtures/conformance/provi… ✅ pass live s2-vocab-missing.txt, s2-vocab-write.txt, s2-vocab-green.txt, s2-conformance.txt, s2-manifests-green.txt, s2-boundary-green.txt, s2-lane-with-pack.txt, s2-typecheck.txt
Adversarial: each guard refuses its violation — a core file importing @metaobjectsdev/pack-smoke fails the boundary gate ('core names a pack coordinate'), a package.json version that disagrees with pa… ✅ pass live s3-boundary-violation.txt, s3-manifest-violation.txt, s3-corechange-violation.txt, s3-conformance-providerless.txt, s3-conformance-providerless-fixed.txt
  • scripts/ci-local.sh --affected --strict-toolchains
  • baseline broad regression: scripts/ci-local.sh --affected --strict-toolchains passed at the target commit (configured test command, not re-run)
  • scripts/ci-local.sh --only packs on the untouched skeleton — lane passes with the no-pack note
  • bun scripts/check-pack-boundary.ts and bun scripts/check-pack-manifests.ts on the untouched skeleton — both green, including the release-tooling scan that plants public pack packages in a scratch root and asserts publish-set / check-publish-intent / check-no-prerelease-versions never enumerate packs/
  • disposable packs/smoke happy path: bun scripts/pack-vocabulary.ts smoke (missing pin refused, --write pins it, re-check green 'vocabulary pinned, leaves core alone'), bun scripts/pack-conformance.ts smoke ('1 pass' through the TS adapter composed with the pack's provider), bun scripts/check-pack-manifests.ts ('OK (1 pack)'), bun scripts/check-pack-boundary.ts ('OK (1 pack(s)...)')
  • MO_CI_PACKS_BLOCKING=1 scripts/ci-local.sh --only packs with the pack present — core build ✓, blocking 'pack smoke' step ✓ (typecheck + vocabulary + conformance)
  • adversarial: core file importing @metaobjectsdev/pack-smoke → boundary gate exits 1 'core names a pack coordinate'; pack.json/package.json version drift → manifests gate exits 1 naming the disagreement; provider calling registry.setDefaultSubType("object", "value") → vocabulary gate exits 1 'does not leave core alone — changed: default object'; pack corpus scenario whose providers.json omits the pack → pack-conformance exits 1 'providers.json must name "metaobjects-smoke"', and passes once it names it
  • cleanup verification: worktree git status clean after removing the throwaway pack and restoring bun.lock; boundary + manifests gates re-run green on the clean tree
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…t pack conformance (ADR-0069)

ADR-0069 records the ruling on independent packs: Metamodel N.M names the
default bundle only; an independent pack lives in packs/<name>/, carries its
own version and changelog, is carried only by the ports its pack.json lists,
and is never in expected-registry.json; core never depends on a pack; the
provider contract is covered by core's package version. GOVERNANCE.md,
extending-with-providers.md, CONFORMANCE.md, compatibility-policy.md and
RELEASING.md gain the matching paragraphs. RELEASING.md's stale
single-package npm patch section is replaced, and the 1.3.0 changelog line
says 13 publish candidates.

The skeleton, with no pack in it:
- packs/*/typescript joins the root Bun workspace; the root build and
  typecheck scripts (and the pre-push hook, ci-local.sh and
  integration-test.sh, which call them) name core's workspace directories
  instead of --filter '*'.
- scripts/check-pack-boundary.ts: core names no pack coordinate or packs/
  path, no pack id or pinned type is in the bundle, and core's release
  gates do not see a planted pack package.
- scripts/check-pack-manifests.ts: each pack.json is well formed and agrees
  with its ports' native manifests.
- a packs lane in ci-local.sh (blocking for a pack's own change, a named
  non-failing SKIP canary on core changes), the lane-map row, the hosted
  ts matrix entry, packs/README.md and a MAINTAINERS.md area.

Pack conformance in TypeScript: runCorpus, a corpus-root entry point in
@metaobjectsdev/conformance; createTsAdapter(extraProviders) in the metadata
test adapter; scripts/pack-vocabulary.ts (pinned vocabulary plus the
leaves-core-alone check) and scripts/pack-conformance.ts.

No vocabulary, metamodelVersion, expected-registry.json or package version
changes.
A packs job on the self-hosted runner, gated on the ts port and mapped in
ci-ports-to-run.sh so a red packs lane on main is re-run by the
known-green selection. The blocking/canary decision diffs against the
push's before SHA; nightly and dispatch runs treat every pack as a canary.
- pack_is_blocking captures the changed-path list before grepping, so
  pipefail plus grep -q can no longer turn a pack's own change into a
  non-blocking canary.
- the leaves-core-alone check fails a child rule with a lower bound added
  to a type the pack does not own (the registry already refuses a
  required projected attribute).
- runCorpus applies requireProviders before skipping docs-only and
  contract-only scenarios, does not pass a corpus with nothing runnable,
  and reports an adapter throw as that scenario's failure.
- check-pack-manifests accepts caret, tilde, ~= and bounded intervals.
- the live build and typecheck instructions say bun run build / bun run
  typecheck instead of --filter '*'.
- ADR-0069 and the lane map say the pack-only selection holds under
  --affected; the hosted workflows select by port.
- conformance: runAndClassify and loadErrorCodes are the shared step; the
  core metadata conformance test and runCorpus both call them, so the
  classification lives in one place.
- lib/packs: typescriptPackNames and packNamesFromArgs replace the copies
  in pack-vocabulary and pack-conformance.
- pack-vocabulary returns core problems and the committed pin directly
  instead of re-deriving them by message prefix and a second read.
- ci-local: step_canary is a step mode (timed, list-only aware); the
  change's path list is computed once per run, not once per pack.
- check-pack-boundary parses the manifests once and builds each id regex
  once; the test no longer repeats the full-repo scan the gate runs.
- check-pack-manifests dispatches native checks from a per-port table.
@dmealing
dmealing merged commit df15a0e into main Nov 25, 2026
11 checks passed
@dmealing
dmealing deleted the fm/mo-packs-a0-skeleton branch November 25, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant